<template>
  <div class="detail">
    <div class="header">
      <LeftOutlined /> <h1>
        {{ item.name }}</h1>
    </div>
    <div class="info-card tab-card">
      <div class="content">
        <img :src="item.pic" :alt="item.name" class="movie-image">
        <div class="movie-info">
          <p>
            <span><strong>上映日期:</strong> {{ item.onlineTime }}</span>
          </p>
          <p>
            <span><strong>上映平台:</strong> {{ item.plats.join(', ') }}</span>
          </p>
          <p>
            <span><strong>类型：</strong>{{ item.tags.join(' | ') }}</span>
          </p>
          <p>
            <span><strong>收视率:</strong> {{ '50%' }}</span>
          </p>
          <p>
            <span><strong>豆瓣评分:</strong> {{ '8.1' }}</span>
          </p>
          <p><a>more ></a></p> 
          <div v-show="false">
            <p>
              <span><strong>导演:</strong> {{ item.director }}</span>
            </p>
            <p>
              <span><strong>编剧:</strong> {{ item.writers.join(', ') }}</span>
            </p>
            <p>
              <span><strong>制作公司:</strong> {{ item.company.join(', ') }}</span>
            </p>
            <p>
              <span><strong>简介:</strong> {{ item.description }}</span>
            </p>
          </div>
        </div>
      </div>
    </div>
    <div>
    <button @click="clickCt" >test</button>
    <label> {{ count }} | {{ doubleCount }}</label>
    </div>
    <a-card :headerStyle="{ color: '#fff'}" class="tab-card" title="数据变化趋势" subti>
      <img style="width: 100%" src="https://pic.616pic.com/ys_bnew_img/00/26/48/BvkpdDnLbn.jpg" />
    </a-card>
    <a-card class="tab-card" title="世界设定和背景">
      <a-table :dataSource="contents.data" :columns="contents.columns" :showHeader="false" :pagination="false"></a-table>
    </a-card>
    <a-card class="tab-card" title="剧情分析">
      <a-table :dataSource="contents.data" :columns="contents.columns" :showHeader="false" :pagination="false"></a-table>
    </a-card>
    <a-card class="tab-card" title="制作">
      <a-table :dataSource="contents.data" :columns="contents.columns" :showHeader="false" :pagination="false"></a-table>
    </a-card>
    <a-card class="tab-card" title="人物关系">
      <a-table :dataSource="contents.data" :columns="contents.columns" :showHeader="false" :pagination="false"></a-table>
    </a-card>
    <a-card class="tab-card" title="人物分析">
      <div v-for="char in characters.data" :key="char" class="characterCard">
        <img />
        <label>{{ char.char }}({{ char.actor }} 饰)</label>
        <p></p>
      </div>
    </a-card>
    <a-card class="tab-card" title="受众人群画像" subti>
      <img style="width: 100%" src="https://pic.616pic.com/ys_bnew_img/00/26/48/BvkpdDnLbn.jpg" />
    </a-card>
  </div>
</template>

<script>
import mockData from '@/mock/detail.js'
import { useCounterStore } from '@/stores/counter.js'
 import { LeftOutlined } from '@ant-design/icons-vue'
export default {
  components: { LeftOutlined },
  computed: {
    item() {
      return mockData.item
    },
    contents() {
      return mockData.contents
    },
    characters() {
      return mockData.characters
    },
    count() {
      return useCounterStore().count
    },
    doubleCount() {
      return useCounterStore().doubleCount
    }
  },
  methods: {
    clickCt() {
      useCounterStore().increment()
    }
  }

};
</script>

<style lang="less" scoped>
/* 样式可以根据你的需要自行添加 */
.detail {
  margin: 0;
  background-color: #001529;
  color: #fff;
  .header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: solid 1px #11263a;
    h1 {
      margin-left: 10px;
      text-align: left;
      font-size: 20px;
    }
  }
  .info-card {
    overflow: hidden;
    .content {
      position: relative;
      padding: 0 10px 0 105px;
      color: #fff;
      text-align: left;
      font-size: 13px;
      .movie-image {
        width: 80px;
        height: 120px;
        margin: 0px 0;
        position: absolute !important;
        left:10px;
        top: 2px;
        border-radius: 5px;
        overflow: hidden;
        box-shadow: 0 3px 8px rgba(255,255,255,.2);
      }
      .movie-info {
        text-align: left;
        margin: 0;
        padding: 0;
        p { margin-bottom: 0px }
      }
    }
    .movie-description {
      margin: 30px 0;
    }
    .icon {
      position: absolute;
      right: 20px; top: 20px;
      height: 70px;
      width: 140px;
      line-height: 58px;
      border-radius: 35px;
      color: #fff;
      background-color: rgba(255,255,255, .2);
      border:double 6px #041527;
      text-align: center;
      font-size: 18px;
    }
  }
  .tab-card {
    margin: 10px 10px 15px 10px;
    box-shadow: 0 3px 8px rgba(66,66,66,.2);
  }
}



</style>
